package full_search;

import env.Action;
import env.Enviroment;
import env.Tile;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.PriorityQueue;

/**
 *
 * @author user
 */
public class FullAStar extends FullSearch {
    //private Vector<Tile> flags = null;


 
    @Override
    public LinkedList<Action> search() {
        
        //findAllFlags();
        MyQueue q=new MyQueue(){
            PriorityQueue<FullNode> queue=new PriorityQueue<FullNode>(10, new Comparator<FullNode>(){
            /**
             * return positive if first is greater then second.
             */
            @Override
            public int compare(FullNode o1, FullNode o2) {
                return o1.f-o2.f;
            }
        });
            public FullNode poll() {
                return queue.poll();
            }

            public void add(FullNode n) {
                queue.add(n); 
            }

            public boolean isEmpty() {
                return queue.isEmpty();
            }
            
        };
        
        return super.graphSearch(q);
        
    }    
}
